<div class="modal-dialog modal-md">
    <form id="ajaxForm" method="post" class="form-horizontal" action="/{{controller.active}}" data-validate="parsley">
        <input type="hidden" value="{{id}}" name="id">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">&times;</button>
                <h4 class="modal-title">{{controller.referer()|get_pathname|get_remark_type}}</h4>
            </div>
            <div class="modal-body">
                <div class="form-group">
                    <label class="col-sm-3 control-label">操作类型</label>
                    <div class="col-sm-9">
                        <div class="row">
                            <div class="col-md-8 ">
                                <input type="hidden" name="operation" class="input-sm form-control" required readonly
                                    value="{{controller.meta_title}}">
                                <label class="control-label">{{controller.meta_title}}</label>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">物料大类</label>
                    <div class="col-sm-9">
                        <div class="row">
                            <div class="col-md-8 ">
                                <select class="form-control input-sm" name="pid" >
                                    <option value="" style="display: none"></option>
                                    {% for item in dataSelect %}
                                    <option value="{{item.id}}">{{item.label}}</option>
                                    {% endfor %}
                                </select>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">物料名称</label>
                    <div class="col-sm-9">
                        <div class="row">
                            <div class="col-md-8 ">
                                <input class="form-control" placeholder="请输入物料名称" name="label" maxlength="6"></input>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <a href="javascript:;" class="btn btn-default" data-dismiss="modal">关闭</a>
                <a href="javascript:;" class="btn btn-primary btn-s-md ajax-post" type="submit"
                    target-form="form-horizontal">确定</a>
            </div>
        </div><!-- /.modal-content -->
    </form>
</div><!-- /.modal-dialog -->
<script>
    $('select[name="gsmc"]').change(function () {
        var index = $(this).get(0).selectedIndex;
        $('select[name="send_userid"]').attr("disabled",true).hide().eq(index - 1).attr("disabled",false).show();
        $('select[name="appmobile"]').attr("disabled",true).hide().eq(index - 1).attr("disabled",false).show();
    });
    $('select[name="send_userid"]').change(function(){
        var index = $(this).get(0).selectedIndex;
        console.log('select[name="send_userid"]',index)
        $('select[name="appmobile"]:enabled').prop('selectedIndex',index);
    })
    $('select[name="appmobile"]').change(function(){
        var index = $(this).get(0).selectedIndex;
        console.log('select[name="appmobile"]',index)
        $('select[name="send_userid"]:enabled').prop('selectedIndex',index);
    })
</script>